<template>
	<view class="mainPage whitePage" :style="{'padding-top': `${$store.state.safeArea.top || 0}px`, 'padding-bottom': `${$store.state.safeArea.bottom || 0}px`}">
		<public-head :title="title"></public-head>
		<view class="box" v-if="yaoDetail">
			<view class="top">
				<!-- <image :src="yaoDetail.dr_img" mode=""></image> -->
				<u-swiper :list="yaoDetail.dr_img" height="416" :autoplay="false"></u-swiper>
				<view class="price">
					¥ {{yaoDetail.dr_price}}
				</view>
				<view style="color: #909090;font-size: 24rpx;text-decoration:line-through;margin-bottom: 18rpx;">
					¥ {{yaoDetail.dr_original_price}}
				</view>
				<view class="info">
					{{yaoDetail.dr_name}}{{yaoDetail.dr_model}}
				</view>
			</view>
			<view class="bottom">
				<view class="title">药品说明</view>
				<view class="desc">
					<rich-text :nodes="yaoDetail.dr_details"></rich-text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var that
	import publicHead from "@/components/publicHead/publicHead.vue"
	export default {
		components: {
			publicHead
		},
		data() {
			return {
				title: '药品详情',
				yaoDetail:""
			}
		},
		onLoad(options) {
			that=this
			that.postData(options.drugs_id)
		},
		methods: {
			postData(drugs_id){
				that.$postAjax1('Doctorsside_drugs_info',{
					drugs_id:drugs_id,
				},function(data){  //https://ask.suoweilai.com/Doctorsside_drugs_info  医生端-药品 - 医生端-医生药品详情
					that.yaoDetail=data.data.data
					// console.log(data.data.data,99999999999)
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.box{
	padding: 20rpx 32rpx;
	.top{
		border-bottom: 2rpx solid rgba(0,0,0,0.08);
		image{
			display: block;
			width: 100%;
			height: 416rpx;
			margin-bottom: 32rpx;
			border-radius: 16rpx;
		}
		.price{
			font-size: 32rpx;
			font-weight: bold;
			color: #D8021C;
			line-height: 38rpx;
		}
		.info{
			font-size: 28rpx;
			font-weight: 400;
			color: #343434;
			line-height: 40rpx;
			margin-bottom: 18rpx;
		}
	}
	.bottom{
		.title{
			padding: 18rpx 0 32rpx;
			font-size: 28rpx;
			font-weight: 500;
			color: #242424;
			line-height: 40rpx;
		}
		.desc{
			font-size: 28rpx;
			font-weight: 400;
			color: #343434;
			line-height: 40rpx;
			white-space: pre-line;
		}
	}
}
</style>


